home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog Special Freeware 31
/
FreelogHS31.iso
/
ArgentCompta
/
FASTCAISSE
/
Setup FASTCAISSE.exe
/
{app}
/
A faire60.sql
< prev
next >
Wrap
Text File
|
2004-05-13
|
1KB
|
40 lines
alter tABLE ARTICLES ADD STOCK_DISPO COMPUTED BY (DISPO-RESERVE);
ALTER TABLE PIECES ADD LIVRE T_BOOLEAN;
ALTER TABLE PIECES ADD ORG_FRACTION integer;
ALTER TABLE PIECES ADD PC_FRACTION POURCENT;
ALTER TABLE PIECES ADD CODEMAGASIN VARCHAR(15);
COMMIT;
CREATE PROCEDURE "SET_LIVRE"
(
"INVALUE" INTEGER
)
AS
DECLARE VARIABLE v1 INTEGER;
DECLARE VARIABLE v2 INTEGER;
BEGIN
SELECT COUNT(INDX) FROM PIECES WHERE INDX=:INVALUE AND TYPEPIECE IN (1,2,3,12) INTO :v1;
IF (v1>0) THEN /* TESTER SI QTE */
begin
SELECT COUNT(NOLIGNE) FROM LIGNES WHERE INDEXPIECE=:INVALUE AND QUANTITE IS NOT NULL AND QUANTITE<>0 INTO :v2;
if (v2=0) THEN /* IL N'EXISTE PAS DE QTE DANS LES LIGNES DE LA PIECE */
UPDATE PIECES SET LIVRE=1 WHERE INDX=:INVALUE;
ELSE
UPDATE PIECES SET LIVRE=0 WHERE INDX=:INVALUE;
END
ELSE UPDATE PIECES SET LIVRE=NULL WHERE INDX=:INVALUE;
SUSPEND;
end
;
CREATE PROCEDURE "ALL_LIVRE"
AS
DECLARE VARIABLE V1 INTEGER;
BEGIN
FOR SELECT INDX FROM PIECES INTO :v1 DO EXECUTE PROCEDURE SET_LIVRE(:v1);
END
;
EXECUTE PROCEDURE ALL_LIVRE;
SET GENERATOR VERSION_BASE TO 60;